package com.hoas.quickstart.threads.chapter01.chapter01_2_3;

public class Run {

    public static void main(String[] args) {


        try {
            System.out.printf(">> 该demo演示了线程具有随机性 << \n");

            MyThread myThread = new MyThread();
            myThread.setName("myThread");
            myThread.start();

            for (int i = 0 ; i < 10; i++) {
                int time = (int) (Math.random() * 1000);

                Thread.sleep( time );

                System.out.println("run=" + Thread.currentThread().getName());
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }


    }

}
